<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue.observable</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="root">
    {{message}}
    <button @click="change">Change</button>
</div>
<script>
    const state = Vue.observable({ message: 'Vue 2.6' })
    const mutation = {
        setMessage(value) {
            state.message = value
        }
    }
    new Vue({
        el: '#root',
        computed: {
            message() {
                return state.message
            }
        },
        methods: {
            change() {
                mutation.setMessage('Vue 3.0')
            }
        }
    })
</script>
</body>
</html>